package com.easylinkin.sm.controller;

import com.easylinkin.sm.constant.LogConstant;
import com.easylinkin.sm.entity.I18n;
import com.easylinkin.sm.service.I18nService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import site.morn.boot.data.CrudControllerSupport;
import site.morn.log.OperateGroup;
import site.morn.rest.RestBuilders;
import site.morn.rest.RestMessage;
import site.morn.rest.RestModel;

/**
 * 国际化管理
 *
 * @author wujie
 * @since 1.0.0, 2019/8/19
 */
@Api(tags = "国际化管理")
@OperateGroup(value = "api/i18n", args = LogConstant.Module.I18N)
@RestController
@RequestMapping("/i18n")
public class I18nController extends CrudControllerSupport<I18n, Long, I18nService> {

  @ApiOperation("获取国际化信息")
  @PostMapping(value = "searchAll")
  public RestMessage searchAll(@RequestBody RestModel<I18n> model) {
    List<I18n> i18ns = service().searchAll(model);
    return RestBuilders.successMessage(i18ns);
  }

}
